﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Text;

namespace Colorful.CMS.Core
{
    public static class CMSHelper
    {
        /// <summary>
        /// 获取图标样式
        /// </summary>
        /// <param name="icon"></param>
        /// <returns></returns>
        public static string GetIcon(string icon)
        {
            if (string.IsNullOrEmpty(icon))
                return "";
            icon = icon.ToLower();
            if (icon.StartsWith("am-icon"))
                return icon;
            else if (icon.StartsWith("icon-"))
                return $"icon {icon}";
            else if (icon.StartsWith("ic-"))
                return $"ic {icon}";
            return $"am-icon-{icon}";
        }
    }
}
